
/**
 * Represents a list in an input
 * 
 * @author Chase Miller
 * 
 */
public class MyList {
    
    private Sequence sequence;
    private String opening, closing;
    
    /**
     * Constructs a list (one that is empty and contains no sequence).
     * 
     * @param opening
     *            - e.g. (
     * @param closing
     *            - e.g. )
     */
    public MyList(String opening, String closing) {
	this.opening = opening;
	this.closing = closing;
    }
    
    /**
     * Constructs a list that contains a sequence
     * 
     * @param opening
     *            - e.g. (
     * @param closing
     *            - e.g. )
     * @param sequence
     */
    public MyList(String opening, String closing, Sequence sequence) {
	this.opening = opening;
	this.closing = closing;
	this.sequence = sequence;
    }
    
    public String toString() {
	if (this.sequence != null) {
	    return this.opening + this.sequence.toString() + this.closing;
	} else {
	    // This must be an empty list.
	    return this.opening + this.closing;
	}
    }
}
